import * as React from 'react';

import AddTodo from './container/addTodo';
import VisibleTodoList from './container/visibleTodoList';
import Footer from './components/footer';
import MyTest from './components/test';
import DemoGetSnapshotBeforeUpdate from 'src/components/learn/DemoGetSnapshotBeforeUpdate'


// import logo from './../logo.svg';
import './App.css';

class App extends React.Component<any, {time: any}> {
    constructor(props: any) {
        console.log(props);
        super(props);
        this.state = {time: 1};
    }

    private changeTime() {
        this.setState({time: this.state.time + 1});
    }
    
    public render() {
        const { time } = this.state;
        console.log('render');
        return (
            <div className="App">
                <MyTest time={time} />
                <AddTodo />
                <VisibleTodoList />
                <Footer />
                <button onClick={() => {this.changeTime();}}>修改时间</button>
                <DemoGetSnapshotBeforeUpdate />
            </div>
        );
    }
}

export default App;
